云城通用插件

Module名:wxYCCommon

1 跳转到wkwebview: gotoWebView:callback:

1.1 入参
{
webviewUrl = "URL";
}
参数 类型 说明
webviewUrl URL
1.2 出参

2. 获取用户鉴权码: getAuthCode:callback:

2.1 入参
{ appkey: '9d67803145' }
参数 类型 说明
appkey 开放平台颁发的appId
2.2 出参
{
"msg":"请求成功",
"data": {
"access_token":"e1101**************ae735",
"openid":"OWQ2****************d4"
},
"code":"0"
}
参数 类型 说明
access_token 返回token
openid 用户id

3. 根据用户鉴权码获取access_token: getAccessToken:callback:

3.1 入参
     { 
 appid: '091102c4-7', // appId为云城开放平台申请服务颁发的appid 
 secret: 'ed*******************84', // secret为云城开放平台申请服务颁发的APPKey
 code: 'hV85zJE4wc32SeHx' //code为鉴权后获取的code
}
参数 类型 说明
appid 开放平台颁发的appId
secret secret为云城开放平台申请服务颁发的APPKey
code code为鉴权后获取的code
3.2 出参
{
  "ret": "0",
 "errorCode": null,
 "msg": "ok",
 "data": {
"access_token": "05652988-5b6d-4400-bbcf-0b62482e104e",
"refresh_token": {
  "value": "3aea1a1b-3747-47c1-9cde-dfe3ebeff099"
},
"expired": "false",
"openid": "MDkxMTAyYzQtNwbba9cd68039ddbc0",
"scope": "[\"app\"]",
"expiration": "1547128449790", // access_token有效期截止时间戳
"token_type": "bearer",
"expires_in": "29232" // access_token有效期时长单位为s
  },
  "success": true
}
参数 类型 说明
access_token 返回token
refresh_token 刷新token
expired 是否过期
expiration access_token有效期截止时间戳
token_type token 类型一般都是bearer(目前没有其它类型)
expires_in access_token有效期时长单位为s

4.获取用户信息: getUserInfo:callback:

4.1 入参
{
 access_token: "05652988-5b6d-4400-bbcf-0b62482e104e",
 openid: "MDkxMTAyYzQtNwbba9cd68039ddbc0"
}
4.2 出参
    {
    "ret": "0",
    "errorCode": null,
    "msg": "ok",
   "data": {
   "aliasName": "小星星",
   "openid": "MDkxMTAyYzQtNwbba9cd68039ddbc0",
   "headIconUrl": " http://oss-ydpt-a-szzb.oss-cn-shenzhen.aliyuncs.com/head/2018122815085a7081b15449fc88572220861d73fd.jpg?x-oss-process=image/resize ,w_200"
     },
     "success": true
   }
参数 类型 说明
aliasName 用户名称
openid 用户id
headIconUrl 用户头像地址

5. 子服务刷新token: refreshToken:callback:

5.1 入参
{"refresh_token":"2a44d19a-a11b-42a2-84d3-f5b400a26643","grant_type":"refresh_token","appid":"smarthomeapp"}
参数 类型 说明
refresh_token 刷新token
grant_type 授权类型
appid 开放平台颁发的appId
.2 出参
 {
"smsg": null,
"ret": "0",
"errorCode": null,
"msg": "ok",
"data": {
    "access_token": "b681f3ba-84c5-4457-bdcf-7b2e53b1bafd",
    "refresh_token": {
        "value": "4223f9bd-dbdf-4b5c-aa26-a4e5834c947b"
    },
    "unionid": "",
    "expired": "false",
    "openid": "c21hcnRob21lYXBw5078bae0f3f8917b",
    "scope": "[\"app\"]",
    "expiration": "1621671729561",
    "token_type": "bearer",
    "expires_in": "86399"
},
"time": 1621585330561
}
参数 类型 说明
access_token 返回token
refresh_token 刷新token
expired 是否过期
expiration access_token有效期截止时间戳
token_type token 类型一般都是bearer(目前没有其它类型)
expires_in access_token有效期时长单位为s
unionid 服务商的公共用户id
scope 授权范围(token使用权限范围)
openid 用户id

6.1. 对图片做裁剪: capture:callback:

6.1 入参
x:x方位
y:y方位
width:宽
height:高
{
"x":"0"
"y":"0"
"width":"100"
"height":"100"
}
参数 类型 说明
x x方位
y y方位
width
height
6.2 出参
{"res":"1","msg":"成功","data":{"outputPath":"xxx/xxx/xx.png"}}
参数 类型 说明
outputPath 图片地址

7. 获取唯一标示码uuid: getDeviceId:

7.1 入参
7.2 出参
{"code":"0","msg":"成功","data":{"deviceId":"3232323232"}}
参数 类型 说明
deviceId uuid

8.设置界面的防截屏: setScreenShotAction:callback:

8.1 入参
{"isBanScreenshot":"1"}
参数 类型 说明
isBanScreenshot 是否防截屏1:开启,0不开启
8.2 出参
{"code":"0","msg":"成功"}

9.发送邮件: sendToEmail:callback:

9.1 入参
{
"mailAddress":"http://....",
"content":"内容",
"subject":"标题"
}
参数 类型 说明
mailAddress 邮件地址
content 邮件内容
subject 邮件标题
9.2 出参

{"code":"0","msg":"成功","data":{"isExistMailApp":"1"}}

参数 类型 说明
isExistMailApp 0:邮箱账户未激活或是未配置账户信息

results matching ""

    No results matching ""